package com.xiaomaoguai.redis.entity;

import java.io.Serializable;

/**
 * @author :WeiHui.Zhang
 * @Description:统一返回类型
 * @FileName: MessageModel.java
 * @Date: 2016年5月30日 下午5:27:18
 * @Version:V1.00
 */
public class MessageModel implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 返回结果码(可无)
	 */
	private int code;
	/**
	 * 返回消息(可无)
	 */
	private String msg;
	/**
	 * ajax请求是否成功,操作是否正确(must)
	 */
	private boolean success;
	/**
	 * 返回实体结果
	 */
	private Object result;

	/**
	 * @param success 是否成功
	 * @param result  结果
	 */
	public MessageModel(boolean success, Object result) {
		super();
		this.success = success;
		this.result = result;
	}

	/**
	 * @param success 是否成功
	 */
	public MessageModel(boolean success) {
		super();
		this.success = success;
	}

	/**
	 * 构造方法
	 */
	public MessageModel() {
		super();
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public Object getResult() {
		return result;
	}

	public void setResult(Object result) {
		this.result = result;
	}

	@Override
	public String toString() {
		return "MessageModel [code=" + code + ", msg=" + msg + ", success=" + success + ", result=" + result + "]";
	}

}
